package cn.brondfish.icedfish.database.system.entity;

import static androidx.room.ForeignKey.CASCADE;

import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;

@Entity(tableName = "sys_user_role",
        primaryKeys = {"device","rolekey"},
        foreignKeys = @ForeignKey(entity = SysUser.class,
                parentColumns = "device",
                childColumns = "device",
                onDelete = CASCADE
        )
)
public class SysUserRole {
    @NonNull
    @ColumnInfo(name = "device")
    public String device;
    @NonNull
    @ColumnInfo(name = "rolekey")
    public String rolekey;

    @NonNull
    public String getDevice() {
        return device;
    }

    public void setDevice(@NonNull String device) {
        this.device = device;
    }

    @NonNull
    public String getRolekey() {
        return rolekey;
    }

    public void setRolekey(@NonNull String rolekey) {
        this.rolekey = rolekey;
    }
}
